package com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.mapper;

import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.ModelQueryNoPageVo;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.model.ModelEventTempQuery;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.FlowEventTemp;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.FlowModelQueryInfo;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.ModelQueryVo;
import com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.entities.ModelVersionDetail;
import org.flowable.engine.impl.persistence.entity.ByteArrayEntityImpl;

import java.util.Date;
import java.util.List;

/**
 * @author cheng.huaxing
 * @date 2019-01-27
 */
public interface FlowModelQueryDAO {
    List<FlowModelQueryInfo> selectList(ModelQueryVo modelQueryVo);

    ByteArrayEntityImpl selectModelXml(String deploymentId);

    List<FlowModelQueryInfo> selectModel(String key);

    List<ModelVersionDetail> selectModelVersionDetail(String flowCode);

    /**
     * 获取流程模型列表
     *
     * @param modelQueryNoPageVo
     * @return
     */
    List<FlowModelQueryInfo> getModelList(ModelQueryNoPageVo modelQueryNoPageVo);


    List<FlowModelQueryInfo> selectModelList();


    int insertEventTemp(FlowEventTemp flowEventTemp);


    List<FlowEventTemp> selectEventTemp(ModelEventTempQuery modelEventTempQuery);

    int deleteEventTemp(String modelId);

    int selectEventsByModelIdAndDate(String modelId, Date lastUpdateTime);

    FlowModelQueryInfo selectModelByModelId(String modelId);

    List<String> getModelIdFromTemp(ModelEventTempQuery modelEventTempQuery);

    List<FlowModelQueryInfo> selectModelListByKey(String modelKey);

}
